package com.yuan.order.util;

import com.yuan.order.controller.OrderInfoController;
import com.yuan.order.entity.OrderInfoEntity;
import com.yuan.order.service.OrderInfoService;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class Cust {
    @Autowired
    OrderInfoService service;

    @RabbitListener(queues = "xiao")
    public void s(OrderInfoEntity entity){
        try {
            service.save(entity);
        }catch (Exception e){
            System.out.println("已有");
        }
    }
}
